import 'package:flutter_test/flutter_test.dart';
import 'package:m_todo/domain/service/todo_service.dart';
import 'package:m_todo/domain/use_case/todo_use_case.dart';
import 'package:m_todo/store/file_todo_store.dart';

main() {
  final String dir = './data/';
  final String todoFileName = 'todo';
  var useCase = TodoUseCase(
      TodoService(FileTodoStore(dir: dir, todoFileName: todoFileName)));
  group('测试TodoUseCase', () {
    test('测试add', () async {
      var testTodo = 'testTodoX5';
      await useCase.add(testTodo);

      var unDoneList = await useCase.getUnDoneList();
      expect(unDoneList.last.content, testTodo);
      expect(unDoneList.last.index != null, true);
    });
  });
}
